package com.example.importDemo.demo01;

import com.example.importDemo.config.AppConfig;
import com.example.importDemo.entity.NorMal;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 使用基于java配置类的方式加载Spring的应用上下文
 */
public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(AppConfig.class);
        ac.start();
        NorMal normal = ac.getBean(NorMal.class);
        System.out.println(normal != null);

        normal.setMsg("hello");
        System.out.println(normal.getMsg());
    }
}

